package com.ljn.controller;

import com.ljn.core.dto.common.Response;
import com.ljn.core.dto.common.command.projectcommand.ProCommand;
import com.ljn.facade.ProFacade;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.inject.Inject;

/**
 * Created by liujunnan on 2017/11/15.
 * 项目管理展示层
 */
@Controller
@RequestMapping("/project")
public class ProjectManagerController {

    @Inject
    ProFacade proFacade;

    @ResponseBody
    @PostMapping(value = "/launchPro")
    public Response launchPro(@RequestBody ProCommand proCommand) {

        return proFacade.addPro(proCommand);
    }

    @ResponseBody
    @PostMapping(value = "/receivePro")
    public Response receivePro(@RequestBody ProCommand proCommand) {

        return proFacade.recPro(proCommand);

    }

    @ResponseBody
    @PostMapping(value = "/updatePro")
    public Response updatePro(@RequestBody ProCommand proCommand) {

        return proFacade.changePro(proCommand);

    }

}
